import request from '@/utils/request'

// 查询机构信息列表
export function listMechanism(query) {
  return request({
    url: '/customer/mechanism/list',
    method: 'get',
    params: query
  })
}

// 查询机构信息详细
export function getMechanism(mechanismId) {
  return request({
    url: '/customer/mechanism/' + mechanismId,
    method: 'get'
  })
}

// 新增机构信息
export function addMechanism(data) {
  return request({
    url: '/customer/mechanism',
    method: 'post',
    data: data
  })
}

// 修改机构信息
export function updateMechanism(data) {
  return request({
    url: '/customer/mechanism',
    method: 'put',
    data: data
  })
}

// 删除机构信息
export function delMechanism(mechanismId) {
  return request({
    url: '/customer/mechanism/' + mechanismId,
    method: 'delete'
  })
}


// 生成二维码图片
export function generateCode(data) {
  return request({
    url: '/customer/mechanism/qrcode',
    method: 'post',
    data:data
  })
}


// 树的内容
export function getMechanismTree(data) {
  return request({
    url: '/customer/mechanism/getMechanismTree',
    method: 'post',
    data:data
  })
}